import { createStore } from 'vuex'
import createPersistedState from 'vuex-persistedstate'
// 模块
import goodsModele from "./modules/goods";
import user from "./modules/user";
import cart from "./modules/cart";
import category from "./modules/category";

export default createStore({
  modules: {
    goodsModele,
    user,
    cart,
    category
  },
  plugins: [
    // 默认存储在LocalStorage
    createPersistedState({
      key: 'mall-client',
      paths: ['user', 'cart']
    })
  ]
})
